Skip to content

Unify search across sub-sites - #1093

Draft
ctrueden wants to merge 4 commits into
napari:mainfrom
ctrueden:unified-search
Draft

ctrueden wants to merge 4 commits into
napari:mainfrom
ctrueden:unified-search

Conversation

@ctrueden

@ctrueden ctrueden commented Jul 30, 2026 •

Copy link
Copy Markdown
Member

This PR is in response to an issue discussed on the napari Zulip. For convenience, here is the relevant summary:

We noticed two different napari workshop pages:

Only the latter seems to have an obvious link to the Express workshops. The other one ends at 2024, and seems to be all external links—e.g. searching for "express" on this external-links-oriented page does not match anything. (And actually, searching for "express workshop" in the napari.org search bar turns up nothing either.)

This PR addresses the issue by switching to Pagefind, a static client-side search capable of aggregating across multiple indices. It's the perfect (and only, as far as I am aware 😅) solution to the fragmentation of search between sub-sites of documentation.

This is a first cut that works in my local testing (on macOS) between docs and workshops. For it to fully work, the companion PR for napari/workshops#69 must also be merged.

Here is a screenshot of the docs search seeing content from workshops:

search-workshops-from-docs

When the page is wider, the search bar moves to the right instead of centered, along with the search results. A remaining issue is that the new Pagefind-based search results panel is not centered and enlarged like the current docs search—hopefully some additional styling can fix that.

ctrueden added 2 commits July 30, 2026 16:27
Otherwise, this happens:

$ pixi install
Error:   × Failed to update PyPI packages for environment 'default'
  ├─▶ Failed to prepare distributions
  ├─▶ Failed to build `pyproj==3.7.2`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta.build_wheel` failed (exit status: 1)

      [stderr]
      proj executable not found. Please set the PROJ_DIR variable. For more
      information see: https://pyproj4.github.io/pyproj/stable/installation.html

      hint: This usually indicates a problem with the package or the build
      environment.

The pixi.lock pins the macOS baseline for osx-arm64 to __osx=13.0
(line 12). pyproj 3.7.2 only ships an arm64 macOS wheel tagged
macosx_14_0_arm64 — no wheel exists for anything below macOS 14.0.
Since the locked environment's floor (13.0) is below what that wheel
declares as its minimum, uv/pixi considers it incompatible and falls
back to the sdist, which then needs the system PROJ library to compile
against — hence "proj executable not found." rasterio 1.5.0 (also
flagged as "installing from remote, not cached" in the verbose log) is
very likely hitting the identical issue for the same reason. Both are
transitive deps of geopandas/contextily, which the docs deps pull in.
Sphinx's built-in search only covers this site's own pages, so
napari.org/workshops (a separately-built mystmd site) was invisible
to search here and vice versa. Build a Pagefind index alongside the
existing Sphinx build and mount a small widget that merges in the
workshops site's Pagefind index at query time, since both are served
under the same napari.org origin.
@github-actions github-actions Bot added documentation Improvements or additions to documentation maintenance CI, dependencies, and other maintenance labels Jul 30, 2026

@willingc willingc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool addition @ctrueden. I didn't review all the css and js. If it works, it's a very helpful enhancement for users. ✨

@brisvag

brisvag commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@aganders3 maybe you can take a look at the code for review? :)

@melissawm

Copy link
Copy Markdown
Member

Hi all, I don't quite understand why we would want to have this "hard dependency" on the workshops to build the main docs. I am probably missing something but ideally we would only need the index of the workshops and keep all the implementation (javascript, css, search button etc) here in the napari docs repo. Is that possible?

@ctrueden

ctrueden commented Aug 13, 2026 •

Copy link
Copy Markdown
Member Author

I don't quite understand why we would want to have this "hard dependency" on the workshops to build the main docs.

@melissawm The only reference to the workshops is for Pagefind's index merging feature:

  data-merge-paths="/workshops/pagefind/"

The docs here continue to build independently of the napari workshops content; it's just that the client-side javascript tries to grab the search index at the /workshops base as well and combine it, if available, when using the search bar.

Does that answer your question?

@melissawm

Copy link
Copy Markdown
Member

I see! So this would only be a hard requirement for the first time, because the search index on the napari-workshops side is still not set up, correct?

In that case, I'm fine with merging this and iterating if we see opportunity for improvement. I have briefly looked at the CSS and javascript and (not being an expert) it all looks fine to me, so I'll approve!

@brisvag brisvag added the Full docs preview/ready to merge Adding this label will trigger a full docs build for previewing changes. Also @napari-bot make html label Oct 14, 2026
@brisvag brisvag added this to the 0.10.0 milestone Oct 14, 2026
brisvag added a commit to napari/workshops that referenced this pull request Oct 14, 2026
This is a companion PR to napari/docs#1093, which aims to unify the
search functionality between multiple documentation sub-sites, including
`workshops` and `docs`. See napari/docs#1093 for full details.

For this PR to fully work, it must be merged in conjunction with the one
on the `docs` side.

Here is a screenshot of the workshops search seeing content from docs:

<img width="1269" height="1196" alt="search-docs-from-workshops"
src="https://github.com/user-attachments/assets/73864e44-ccfe-4289-9ef9-77d724a816a2"
/>

The trailing hash signs are a rough edge that still needs to be sorted
out.

Co-authored-by: Lorenzo Gaifas <brisvag@gmail.com>
@github-actions

Copy link
Copy Markdown

@TimMonko

Copy link
Copy Markdown
Member

I should have blocked /addressed this PR earlier (even discussed with Curtis in person). I have a draft cross-site branch almost ready to that would go in napari-sphinx-theme and make this all so much easier with pagefind. I will try to squeeze it out this week, but want to make sure I catch up on otehrs. Maybe we could merge these PRs and then revert once the napari-shpinx-theme way is in? That way we even get a sense of how the cross-site searching could function

I'm so sorry for dropping the ball on this.

@brisvag

brisvag commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

I just merged napari/workshops#69 cause I figured at least we can see if it works there... but there's a double search bar now o.o

image

I think @ctrueden did not see that because when the window is small the new one hides the old one xD

@brisvag

brisvag commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@TimMonko I'm happy to also just rever that one and give you time to do the sphinx one.

@TimMonko

Copy link
Copy Markdown
Member

I'm happy to also just rever that one and give you time to do the sphinx one.

@brisvag , sure! I did find that when I was doing my theme draft and it does account for the workshop issue!

@brisvag brisvag removed the Full docs preview/ready to merge Adding this label will trigger a full docs build for previewing changes. Also @napari-bot make html label Oct 14, 2026
@brisvag

brisvag commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

I'll let you take that one over than, so we don't step on each other's toes!

@TimMonko TimMonko removed this from the 0.10.0 milestone Oct 15, 2026
@TimMonko
TimMonko marked this pull request as draft October 15, 2026 02:32
TimMonko added a commit to napari/workshops that referenced this pull request Oct 15, 2026
This reverts commit c5d8d71.

As pointed out that it has some issues here: napari/docs#1093 (comment)

Where there is a duplicated search bar
brisvag added a commit that referenced this pull request Oct 19, 2026
# References and relevant issues

napari/workshops#87

# Description

*`gh pr create` lost my first description so this will be shorter...*

A common issue from folks is that the workshops website is hard to find.
Sensibly, they search napari.org which is not linked to the separate
napari.org/workshops build. Can also see this in #1093. However, cross
site linking still does not resolve this very out of date content. This
PR:

1. Tells folks to look at napari.org/workshops for the materials -- and
how to contribute their own
2. moves the links to past workshops to napari/workshops#87

## Original description

1. redirects all user links to napari.org/workshops and contributing
links to github.com/napari/workshops\
3. I keep hear the old page, but orphan it and redirect it to
napari.org/workshops. This is because there are many public links to
this page (videos, old workshop materials, etc)
4. and napari/workshops#87 sticks the old content in an archive

note: this could be done with sphinx-reredirect but at this scale I
think a single redirect is better than going through napari
deps/constraints and .

---------

Co-authored-by: Lorenzo Gaifas <brisvag@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation maintenance CI, dependencies, and other maintenance

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants